VERSION 5.00
Begin VB.Form FrmAzucares 
   Caption         =   "Form1"
   ClientHeight    =   6645
   ClientLeft      =   60
   ClientTop       =   360
   ClientWidth     =   11400
   LinkTopic       =   "Form1"
   ScaleHeight     =   6645
   ScaleWidth      =   11400
   StartUpPosition =   2  'CenterScreen
   WindowState     =   2  'Maximized
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   285
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   18
      Top             =   0
      Width           =   3495
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      HideSelection   =   0   'False
      Left            =   11280
      Locked          =   -1  'True
      TabIndex        =   17
      Top             =   600
      Width           =   2055
   End
   Begin VB.TextBox Text3 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      HideSelection   =   0   'False
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   16
      Top             =   600
      Width           =   3495
   End
   Begin VB.TextBox Text4 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   15
      Top             =   960
      Width           =   3495
   End
   Begin VB.TextBox Text5 
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   14
      Top             =   1320
      Width           =   3495
   End
   Begin VB.TextBox Text7 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   4560
      Locked          =   -1  'True
      TabIndex        =   13
      Top             =   1680
      Width           =   3495
   End
   Begin VB.TextBox Text11 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      HideSelection   =   0   'False
      Left            =   11280
      TabIndex        =   12
      Top             =   960
      Width           =   2055
   End
   Begin VB.CommandButton Command13 
      Caption         =   "Modificar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   4560
      Picture         =   "FrmAzucares.frx":0000
      TabIndex        =   11
      Top             =   5760
      Visible         =   0   'False
      Width           =   1335
   End
   Begin VB.CommandButton Command12 
      Height          =   495
      Left            =   1320
      Picture         =   "FrmAzucares.frx":058A
      Style           =   1  'Graphical
      TabIndex        =   10
      Top             =   5640
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.CommandButton Command6 
      Caption         =   "Salir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   7680
      Picture         =   "FrmAzucares.frx":0B14
      TabIndex        =   9
      Top             =   5760
      Width           =   1335
   End
   Begin VB.CommandButton Command5 
      Height          =   495
      Left            =   2760
      Picture         =   "FrmAzucares.frx":1016
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   5640
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Guardar"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   400
      Left            =   6120
      Picture         =   "FrmAzucares.frx":15B0
      TabIndex        =   7
      Top             =   5760
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Height          =   495
      Left            =   2040
      Picture         =   "FrmAzucares.frx":1ADE
      Style           =   1  'Graphical
      TabIndex        =   6
      Top             =   5640
      Visible         =   0   'False
      Width           =   615
   End
   Begin VB.ComboBox Combo3 
      Height          =   315
      ItemData        =   "FrmAzucares.frx":2020
      Left            =   4560
      List            =   "FrmAzucares.frx":202A
      TabIndex        =   5
      Text            =   "Negativo"
      Top             =   4560
      Width           =   1215
   End
   Begin VB.ComboBox Combo2 
      Height          =   315
      ItemData        =   "FrmAzucares.frx":2042
      Left            =   4560
      List            =   "FrmAzucares.frx":204C
      TabIndex        =   4
      Text            =   "Negativo"
      Top             =   4080
      Width           =   1215
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      ItemData        =   "FrmAzucares.frx":2064
      Left            =   4560
      List            =   "FrmAzucares.frx":206E
      TabIndex        =   3
      Text            =   "Negativo"
      Top             =   3600
      Width           =   1215
   End
   Begin VB.Label SkinLabel1 
      Height          =   255
      Index           =   1
      Left            =   3240
      TabIndex        =   0
      Top             =   3600
      Width           =   1095
   End
   Begin VB.Label SkinLabel1 
      Height          =   255
      Index           =   2
      Left            =   3240
      TabIndex        =   1
      Top             =   4080
      Width           =   1095
   End
   Begin VB.Label SkinLabel1 
      Height          =   255
      Index           =   3
      Left            =   3240
      TabIndex        =   2
      Top             =   4560
      Width           =   1095
   End
   Begin VB.Label SkinLabel4 
      Height          =   375
      Index           =   0
      Left            =   2520
      TabIndex        =   19
      Top             =   600
      Width           =   1935
   End
   Begin VB.Label SkinLabel3 
      Height          =   255
      Left            =   8520
      TabIndex        =   20
      Top             =   960
      Width           =   2415
   End
   Begin VB.Label SkinLabel2 
      Height          =   255
      Left            =   8520
      TabIndex        =   21
      Top             =   600
      Width           =   2775
   End
   Begin VB.Label SkinLabel1 
      Height          =   255
      Index           =   0
      Left            =   2520
      TabIndex        =   22
      Top             =   0
      Width           =   1935
   End
   Begin VB.Label SkinLabel5 
      Height          =   255
      Left            =   2520
      TabIndex        =   23
      Top             =   960
      Width           =   1935
   End
   Begin VB.Label SkinLabel6 
      Height          =   255
      Left            =   2520
      TabIndex        =   24
      Top             =   1320
      Width           =   1935
   End
   Begin VB.Label SkinLabel8 
      Height          =   255
      Left            =   2520
      TabIndex        =   25
      Top             =   1680
      Width           =   1935
   End
End
Attribute VB_Name = "FrmAzucares"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public Pedido
Public Detalle
Sub mostrarEncabezado(t As DAO.Recordset)
    Dim TP As DAO.Recordset
    Set TP = Base.OpenRecordset("select *from paciente where cod_paciente=" & t("cod_paciente"))
    If Not TP.EOF Then
        Text1.Text = t("cod_pedido")
        Text2.Text = t("fecha")
        Text3.Text = t("PacienteNro")
        Text4.Text = TP("nombres")
        Text5.Text = TP("cedula")
        Text7.Text = t("descrip_pedido")
        Text11.Text = Date
    End If
End Sub
Sub BuscarEncabezado()
    Dim t As DAO.Recordset
    Set t = Base.OpenRecordset("select *from pedido where cod_pedido=" & val(Text1.Text))
    If t.EOF Then
        a = Text1.Text
' Limpiar
        Text1.Text = a
        MsgBox "El pedido no existe"
    Else
        mostrarEncabezado t
    End If
End Sub

Sub Limpiar()
End Sub


Private Sub Command3_Click()
'On Error Resume Next
    Auditar "Guardar", "Azucares", Text1.Text

    Dim t As DAO.Recordset
    Dim x As DAO.Recordset
    
    Base.Execute "update detalles set st='g' where cod_detalle=" & Detalle
    
    Set t = Base.OpenRecordset("Azucares")
    Set x = Base.OpenRecordset("select *from Azucares where cod_pedido=" & Text1.Text)
    If x.EOF Then
        t.AddNew
        t(0) = AutoNumero("cod_Azucares", "Azucares")
    Else
        t.Edit
    End If
        t(1) = Text1.Text
        t(2) = Combo1.Text
        t(3) = Combo2.Text
        t(4) = Combo3.Text
    t.Update
    
    
End Sub
Private Sub Command5_Click()
    Command3_Click
    Base.Execute "update detalles set st='i' where cod_detalle=" & Detalle
    ''Set 'FrmReporte.Report = New RptAzucares
    f = "{pedido.cod_pedido}=" & Text1.Text
    'FrmReporte.Report.RecordSelectionFormula = f
    'FrmReporte.Report.ParameterFields.GetItemByName("nombrelab").AddCurrentValue (NombreLab)
    'FrmReporte.Report.ReadRecords
    'FrmReporte.Show vbModal
End Sub

Private Sub Command6_Click()
    Unload Me: ActGestor
End Sub


Private Sub Form_Load()
    Me.Caption = titulo2("Azucares")
    Text1.Text = Pedido
    BuscarEncabezado

    Limpiar
End Sub


